package nz.jdbcwrapper;

import java.sql.Date;
import java.sql.SQLException;
import java.sql.CallableStatement;
import java.sql.Blob;
import java.sql.Clob;
import java.sql.Ref;
import java.sql.Array;
import java.sql.Time;
import java.sql.Types;
import java.sql.Timestamp;

import java.util.Map;
import java.io.InputStream;
import java.io.Reader;
import java.math.BigDecimal;
import java.net.URL;
import java.util.Calendar;

class WrapperCallableStatement extends WrapperPreparedStatement
  implements CallableStatement
{
  final CallableStatement callableStatement;

  static String arrayPrefix = null;

  WrapperCallableStatement(Data data,
                           Statistic statistic,
                           CallableStatement callableStatement)
  {
    super(data, statistic, callableStatement);
    this.callableStatement = callableStatement;
  }

  /**
   * Registers the OUT parameter in ordinal position
   * <code>parameterIndex</code> to the JDBC type
   * <code>sqlType</code>.  All OUT parameters must be registered
   * before a stored procedure is executed.
   * <p>
   * The JDBC type specified by <code>sqlType</code> for an OUT
   * parameter determines the Java type that must be used
   * in the <code>get</code> method to read the value of that parameter.
   * <p>
   * If the JDBC type expected to be returned to this output parameter
   * is specific to this particular database, <code>sqlType</code>
   * should be <code>java.sql.Types.OTHER</code>.  The method
   * {@link #getObject} retrieves the value.
   * @param parameterIndex the first parameter is 1, the second is 2,
   * and so on
   * @param sqlType the JDBC type code defined by <code>java.sql.Types</code>.
   * If the parameter is of JDBC type <code>NUMERIC</code>
   * or <code>DECIMAL</code>, the version of
   * <code>registerOutParameter</code> that accepts a scale value
   * should be used.
   * @exception SQLException if a database access error occurs
   */
  public void registerOutParameter(int parameterIndex, int sqlType)
    throws SQLException
  {
    long key = 0L;

    if (data.trace >= 4)
      key = Util.traceBegin(prefix + " registerOutParameter(" + parameterIndex + ", " + sqlType + ")");

    try
    {
      callableStatement.registerOutParameter(parameterIndex, sqlType);

      if (data.trace >= 4)
        Util.traceEnd(key, (String)null);
    }
    catch (SQLException e)
    {
      if (data.trace >= 4)
        Util.traceEnd(key, e);
      throw e;
    }
    finally
    {
      checkWarnings();
    }
  }

  /**
   * Registers the parameter in ordinal position
   * <code>parameterIndex</code> to be of JDBC type
   * <code>sqlType</code>.  This method must be called
   * before a stored procedure is executed.
   * <p>
   * The JDBC type specified by <code>sqlType</code> for an OUT
   * parameter determines the Java type that must be used
   * in the <code>get</code> method to read the value of that parameter.
   * <p>
   * This version of <code>registerOutParameter</code> should be
   * used when the parameter is of JDBC type <code>NUMERIC</code>
   * or <code>DECIMAL</code>.
   * @param parameterIndex the first parameter is 1, the second is 2,
   * and so on
   * @param sqlType SQL type code defined by <code>java.sql.Types</code>.
   * @param scale the desired number of digits to the right of the
   * decimal point.  It must be greater than or equal to zero.
   * @exception SQLException if a database access error occurs
   * @see Types
   */
  public void registerOutParameter(int parameterIndex, int sqlType, int scale)
    throws SQLException
  {
    long key = 0L;

    if (data.trace >= 4)
      key = Util.traceBegin(prefix + " registerOutParameter(" + parameterIndex + ", " + sqlType + ", " + scale + ")");

    try
    {
      callableStatement.registerOutParameter(parameterIndex, sqlType, scale);

      if (data.trace >= 4)
        Util.traceEnd(key, (String)null);
    }
    catch (SQLException e)
    {
      if (data.trace >= 4)
        Util.traceEnd(key, e);
      throw e;
    }
    finally
    {
      checkWarnings();
    }
  }

  /**
   * Indicates whether or not the last OUT parameter read had the value of
   * SQL <code>NULL</code>.  Note that this method should be called only after
   * calling a <code>getXXX</code> method; otherwise, there is no value to use in
   * determining whether it is <code>null</code> or not.
   * @return <code>true</code> if the last parameter read was SQL
   * <code>NULL</code>; <code>false</code> otherwise
   * @exception SQLException if a database access error occurs
   */
  public boolean wasNull() throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " wasNull()");

    try
    {
      boolean result = callableStatement.wasNull();

      if (data.trace >= 6)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      throw e;
    }
    finally
    {
      checkWarnings();
    }
  }

  /**
   * Retrieves the value of a JDBC <code>CHAR</code>, <code>VARCHAR</code>,
   * or <code>LONGVARCHAR</code> parameter as a <code>String</code> in
   * the Java programming language.
   * <p>
   * For the fixed-length type JDBC <code>CHAR</code>,
   * the <code>String</code> object
   * returned has exactly the same value the JDBC
   * <code>CHAR</code> value had in the
   * database, including any padding added by the database.
   * @param parameterIndex the first parameter is 1, the second is 2,
   * and so on
   * @return the parameter value. If the value is SQL <code>NULL</code>, the result
   * is <code>null</code>.
   * @exception SQLException if a database access error occurs
   */
  public String getString(int parameterIndex) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getString(" + parameterIndex + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;

    try
    {
      start = System.currentTimeMillis();
      String result = callableStatement.getString(parameterIndex);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, result);
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      throw e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
  }

  /**
   * Gets the value of a JDBC <code>BIT</code> parameter as a <code>boolean</code>
   * in the Java programming language.
   * @param parameterIndex the first parameter is 1, the second is 2,
   * and so on
   * @return the parameter value.  If the value is SQL <code>NULL</code>, the result
   * is <code>false</code>.
   * @exception SQLException if a database access error occurs
   */
  public boolean getBoolean(int parameterIndex) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getBoolean(" + parameterIndex + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      boolean result = callableStatement.getBoolean(parameterIndex);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   * Gets the value of a JDBC <code>TINYINT</code> parameter as a <code>byte</code>
   * in the Java programming language.
   * @param parameterIndex the first parameter is 1, the second is 2,
   * and so on
   * @return the parameter value.  If the value is SQL <code>NULL</code>, the result
   * is 0.
   * @exception SQLException if a database access error occurs
   */
  public byte getByte(int parameterIndex) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getByte(" + parameterIndex + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      byte result = callableStatement.getByte(parameterIndex);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, String.valueOf(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   * Gets the value of a JDBC <code>SMALLINT</code> parameter as a <code>short</code>
   * in the Java programming language.
   * @param parameterIndex the first parameter is 1, the second is 2,
   * and so on
   * @return the parameter value.  If the value is SQL <code>NULL</code>, the result
   * is 0.
   * @exception SQLException if a database access error occurs
   */
  public short getShort(int parameterIndex) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getShort(" + parameterIndex + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      short result = callableStatement.getShort(parameterIndex);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, String.valueOf(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   * Gets the value of a JDBC <code>INTEGER</code> parameter as an <code>int</code>
   * in the Java programming language.
   * @param parameterIndex the first parameter is 1, the second is 2,
   * and so on
   * @return the parameter value.  If the value is SQL <code>NULL</code>, the result
   * is 0.
   * @exception SQLException if a database access error occurs
   */
  public int getInt(int parameterIndex) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getInt(" + parameterIndex + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      int result = callableStatement.getInt(parameterIndex);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, String.valueOf(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   * Gets the value of a JDBC <code>BIGINT</code> parameter as a <code>long</code>
   * in the Java programming language.
   * @param parameterIndex the first parameter is 1, the second is 2,
   * and so on
   * @return the parameter value.  If the value is SQL <code>NULL</code>, the result
   * is 0.
   * @exception SQLException if a database access error occurs
   */
  public long getLong(int parameterIndex) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getLong(" + parameterIndex + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      long result = callableStatement.getLong(parameterIndex);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, String.valueOf(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   * Gets the value of a JDBC <code>FLOAT</code> parameter as a <code>float</code>
   * in the Java programming language.
   * @param parameterIndex the first parameter is 1, the second is 2,
   * and so on
   * @return the parameter value.  If the value is SQL <code>NULL</code>, the result
   * is 0.
   * @exception SQLException if a database access error occurs
   */
  public float getFloat(int parameterIndex) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getFloat(" + parameterIndex + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      float result = callableStatement.getFloat(parameterIndex);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, String.valueOf(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   * Gets the value of a JDBC <code>DOUBLE</code> parameter as a <code>double</code>
   * in the Java programming language.
   * @param parameterIndex the first parameter is 1, the second is 2,
   * and so on
   * @return the parameter value.  If the value is SQL <code>NULL</code>, the result
   * is 0.
   * @exception SQLException if a database access error occurs
   */
  public double getDouble(int parameterIndex) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getDouble(" + parameterIndex + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      double result = callableStatement.getDouble(parameterIndex);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, String.valueOf(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   * Gets the value of a JDBC <code>NUMERIC</code> parameter as a
   * <code>java.math.BigDecimal</code> object with scale digits to
   * the right of the decimal point.
   * @param parameterIndex the first parameter is 1, the second is 2,
   * and so on
   * @param scale the number of digits to the right of the decimal point
   * @return the parameter value.  If the value is SQL <code>NULL</code>, the result is
   * <code>null</code>.
   * @exception SQLException if a database access error occurs
   * @deprecated
   */
  public BigDecimal getBigDecimal(int parameterIndex, int scale) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getBigDecimal(" + parameterIndex + ", " + scale + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      BigDecimal result = callableStatement.getBigDecimal(parameterIndex, scale);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }


  /**
   * Gets the value of a JDBC <code>BINARY</code> or <code>VARBINARY</code>
   * parameter as an array of <code>byte</code> values in the Java
   * programming language.
   * @param parameterIndex the first parameter is 1, the second is 2,
   * and so on
   * @return the parameter value.  If the value is SQL <code>NULL</code>, the result is
   *  <code>null</code>.
   * @exception SQLException if a database access error occurs
   */
  public byte[] getBytes(int parameterIndex) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getBytes(" + parameterIndex + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      byte[] result = callableStatement.getBytes(parameterIndex);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   * Gets the value of a JDBC <code>DATE</code> parameter as a
   * <code>java.sql.Date</code> object.
   * @param parameterIndex the first parameter is 1, the second is 2,
   * and so on
   * @return the parameter value.  If the value is SQL <code>NULL</code>, the result
   * is <code>null</code>.
   * @exception SQLException if a database access error occurs
   */
  public java.sql.Date getDate(int parameterIndex) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getDate(" + parameterIndex + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      java.sql.Date result = callableStatement.getDate(parameterIndex);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   * Get the value of a JDBC <code>TIME</code> parameter as a
   * <code>java.sql.Time</code> object.
   * @param parameterIndex the first parameter is 1, the second is 2,
   * and so on
   * @return the parameter value.  If the value is SQL <code>NULL</code>, the result
   * is <code>null</code>.
   * @exception SQLException if a database access error occurs
   */
  public java.sql.Time getTime(int parameterIndex) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getTime(" + parameterIndex + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      java.sql.Time result = callableStatement.getTime(parameterIndex);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   * Gets the value of a JDBC <code>TIMESTAMP</code> parameter as a
   * <code>java.sql.Timestamp</code> object.
   * @param parameterIndex the first parameter is 1, the second is 2,
   * and so on
   * @return the parameter value.  If the value is SQL <code>NULL</code>, the result
   * is <code>null</code>.
   * @exception SQLException if a database access error occurs
   */
  public java.sql.Timestamp getTimestamp(int parameterIndex)
    throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getTimestamp(" + parameterIndex + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      java.sql.Timestamp result = callableStatement.getTimestamp(parameterIndex);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  //----------------------------------------------------------------------
  // Advanced features:


  /**
   * Gets the value of a parameter as an <code>Object</code> in the Java
   * programming language.
   * <p>
   * This method returns a Java object whose type corresponds to the JDBC
   * type that was registered for this parameter using the method
   * <code>registerOutParameter</code>.  By registering the target JDBC
   * type as <code>java.sql.Types.OTHER</code>, this method can be used
   * to read database-specific abstract data types.
   * @param parameterIndex the first parameter is 1, the second is 2,
   * and so on
   * @return A <code>java.lang.Object</code> holding the OUT parameter value.
   * @exception SQLException if a database access error occurs
   */
  public Object getObject(int parameterIndex) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getObject(" + parameterIndex + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      Object result = callableStatement.getObject(parameterIndex);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }


  //--------------------------JDBC 2.0-----------------------------

  /**
   *
   * Gets the value of a JDBC <code>NUMERIC</code> parameter as a
   * <code>java.math.BigDecimal</code> object with as many digits to the
   * right of the decimal point as the value contains.
   * @param parameterIndex the first parameter is 1, the second is 2,
   * and so on
   * @return the parameter value in full precision.  If the value is
   * SQL <code>NULL</code>, the result is <code>null</code>.
   * @exception SQLException if a database access error occurs
   * @since 1.2
   * @see <a href="package-summary.html#2.0 API">What Is in the JDBC 2.0 API</a>
   */
  public BigDecimal getBigDecimal(int parameterIndex) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getBigDecimal(" + parameterIndex + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      BigDecimal result = callableStatement.getBigDecimal(parameterIndex);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   *
   * Returns an object representing the value of OUT parameter
   * <code>i</code> and uses <code>map</code> for the custom
   * mapping of the parameter value.
   * <p>
   * This method returns a Java object whose type corresponds to the
   * JDBC type that was registered for this parameter using the method
   * <code>registerOutParameter</code>.  By registering the target
   * JDBC type as <code>java.sql.Types.OTHER</code>, this method can
   * be used to read database-specific abstract data types.
   * @param i the first parameter is 1, the second is 2, and so on
   * @param map the mapping from SQL type names to Java classes
   * @return a <code>java.lang.Object</code> holding the OUT parameter value
   * @exception SQLException if a database access error occurs
   * @since 1.2
   * @see <a href="package-summary.html#2.0 API">What Is in the JDBC 2.0 API</a>
   */
  public Object getObject(int i, Map map) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getObject(" + i + ", " + Util.toString(map) + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      Object result = callableStatement.getObject(i, map);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   *
   * Gets the value of a JDBC <code>REF(&lt;structured-type&gt;)</code>
   * parameter as a {@link Ref} object in the Java programming language.
   * @param i the first parameter is 1, the second is 2,
   * and so on
   * @return the parameter value as a <code>Ref</code> object in the
   * Java programming language.  If the value was SQL <code>NULL</code>, the value
   * <code>null</code> is returned.
   * @exception SQLException if a database access error occurs
   * @since 1.2
   * @see <a href="package-summary.html#2.0 API">What Is in the JDBC 2.0 API</a>
   */
  public Ref getRef(int i) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getRef(" + i + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      Ref result = callableStatement.getRef(i);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   *
   * Gets the value of a JDBC <code>BLOB</code> parameter as a
   * {@link Blob} object in the Java programming language.
   * @param i the first parameter is 1, the second is 2, and so on
   * @return the parameter value as a <code>Blob</code> object in the
   * Java programming language.  If the value was SQL <code>NULL</code>, the value
   * <code>null</code> is returned.
   * @exception SQLException if a database access error occurs
   * @since 1.2
   * @see <a href="package-summary.html#2.0 API">What Is in the JDBC 2.0 API</a>
   */
  public Blob getBlob(int i) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getBlob(" + i + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      Blob result = callableStatement.getBlob(i);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   *
   * Gets the value of a JDBC <code>CLOB</code> parameter as a
   * <code>Clob</code> object in the Java programming language.
   * @param i the first parameter is 1, the second is 2, and
   * so on
   * @return the parameter value as a <code>Clob</code> object in the
   * Java programming language.  If the value was SQL <code>NULL</code>, the
   * value <code>null</code> is returned.
   * @exception SQLException if a database access error occurs
   * @since 1.2
   * @see <a href="package-summary.html#2.0 API">What Is in the JDBC 2.0 API</a>
   */
  public Clob getClob(int i) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getClob(" + i + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      Clob result = callableStatement.getClob(i);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   *
   * Gets the value of a JDBC <code>ARRAY</code> parameter as an
   * {@link Array} object in the Java programming language.
   * @param i the first parameter is 1, the second is 2, and
   * so on
   * @return the parameter value as an <code>Array</code> object in
   * the Java programming language.  If the value was SQL <code>NULL</code>, the
   * value <code>null</code> is returned.
   * @exception SQLException if a database access error occurs
   * @since 1.2
   * @see <a href="package-summary.html#2.0 API">What Is in the JDBC 2.0 API</a>
   */
  public Array getArray (int i) throws SQLException
  {
    if (arrayPrefix == null)
      arrayPrefix = "[" + data.connection.id + "][" + id + "][]";

    return new WrapperArray(data, statistic, arrayPrefix, callableStatement.getArray(i));
  }

  /**
   * Gets the value of a JDBC <code>DATE</code> parameter as a
   * <code>java.sql.Date</code> object, using
   * the given <code>Calendar</code> object
   * to construct the date.
   * With a <code>Calendar</code> object, the driver
   * can calculate the date taking into account a custom timezone and locale.
   * If no <code>Calendar</code> object is specified, the driver uses the
   * default timezone and locale.
   *
   * @param parameterIndex the first parameter is 1, the second is 2,
   * and so on
   * @param cal the <code>Calendar</code> object the driver will use
   *            to construct the date
   * @return the parameter value.  If the value is SQL <code>NULL</code>, the result is
   * <code>null</code>.
   * @exception SQLException if a database access error occurs
   */
  public java.sql.Date getDate(int parameterIndex, Calendar cal)
    throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getDate(" + parameterIndex + ", " + Util.toString(cal) + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      java.sql.Date result = callableStatement.getDate(parameterIndex, cal);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   * Gets the value of a JDBC <code>TIME</code> parameter as a
   * <code>java.sql.Time</code> object, using
   * the given <code>Calendar</code> object
   * to construct the time.
   * With a <code>Calendar</code> object, the driver
   * can calculate the time taking into account a custom timezone and locale.
   * If no <code>Calendar</code> object is specified, the driver uses the
   * default timezone and locale.
   *
   * @param parameterIndex the first parameter is 1, the second is 2,
   * and so on
   * @param cal the <code>Calendar</code> object the driver will use
   *            to construct the time
   * @return the parameter value; if the value is SQL <code>NULL</code>, the result is
   * <code>null</code>.
   * @exception SQLException if a database access error occurs
   */
  public java.sql.Time getTime(int parameterIndex, Calendar cal)
    throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getTime(" + parameterIndex + ", " + Util.toString(cal) + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      java.sql.Time result = callableStatement.getTime(parameterIndex, cal);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   * Gets the value of a JDBC <code>TIMESTAMP</code> parameter as a
   * <code>java.sql.Timestamp</code> object, using
   * the given <code>Calendar</code> object to construct
   * the <code>Timestamp</code> object.
   * With a <code>Calendar</code> object, the driver
   * can calculate the timestamp taking into account a custom timezone and locale.
   * If no <code>Calendar</code> object is specified, the driver uses the
   * default timezone and locale.
   *
   *
   * @param parameterIndex the first parameter is 1, the second is 2,
   * and so on
   * @param cal the <code>Calendar</code> object the driver will use
   *            to construct the timestamp
   * @return the parameter value.  If the value is SQL <code>NULL</code>, the result is
   * <code>null</code>.
   * @exception SQLException if a database access error occurs
   */
  public java.sql.Timestamp getTimestamp(int parameterIndex, Calendar cal)
    throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getTimestamp(" + parameterIndex + ", " + Util.toString(cal) + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      java.sql.Timestamp result = callableStatement.getTimestamp(parameterIndex, cal);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }


  /**
   *
   * Registers the designated output parameter.  This version of
   * the method <code>registerOutParameter</code>
   * should be used for a user-named or REF output parameter.  Examples
   * of user-named types include: STRUCT, DISTINCT, JAVA_OBJECT, and
   * named array types.
   *
   * Before executing a stored procedure call, you must explicitly
   * call <code>registerOutParameter</code> to register the type from
   * <code>java.sql.Types</code> for each
   * OUT parameter.  For a user-named parameter the fully-qualified SQL
   * type name of the parameter should also be given, while a REF
   * parameter requires that the fully-qualified type name of the
   * referenced type be given.  A JDBC driver that does not need the
   * type code and type name information may ignore it.   To be portable,
   * however, applications should always provide these values for
   * user-named and REF parameters.
   *
   * Although it is intended for user-named and REF parameters,
   * this method may be used to register a parameter of any JDBC type.
   * If the parameter does not have a user-named or REF type, the
   * typeName parameter is ignored.
   *
   * <P><B>Note:</B> When reading the value of an out parameter, you
   * must use the <code>getXXX</code> method whose Java type XXX corresponds to the
   * parameter's registered SQL type.
   *
   * @param paramIndex the first parameter is 1, the second is 2,...
   * @param sqlType a value from {@link java.sql.Types}
   * @param typeName the fully-qualified name of an SQL structured type
   * @exception SQLException if a database access error occurs
   * @since 1.2
   * @see <a href="package-summary.html#2.0 API">What Is in the JDBC 2.0 API</a>
   */
  public void registerOutParameter(int paramIndex, int sqlType, String typeName)
    throws SQLException
  {
    long key = 0L;

    if (data.trace >= 5)
      key = Util.traceBegin(prefix + " registerOutParameter(" + paramIndex + ", " + sqlType + ", " + Util.toString(typeName) + ")");

    try
    {
      callableStatement.registerOutParameter(paramIndex, sqlType, typeName);

      if (data.trace >= 5)
        Util.traceEnd(key, (String)null);
    }
    catch (SQLException e)
    {
      if (data.trace >= 5)
        Util.traceEnd(key, e);
      throw e;
    }
    finally
    {
      checkWarnings();
    }
  }
  /**
   * @see java.sql.CallableStatement#getArray(String)
   */
  public Array getArray(String parameterName) throws SQLException
  {
    if (arrayPrefix == null)
      arrayPrefix = "[" + data.connection.id + "][" + id + "][]";

    return new WrapperArray(data, statistic, arrayPrefix, callableStatement.getArray(parameterName));
  }

  /**
   * @see java.sql.CallableStatement#getBigDecimal(String)
   */
  public BigDecimal getBigDecimal(String parameterName) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getBigDecimal(" + Util.toString(parameterName) + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      BigDecimal result = callableStatement.getBigDecimal(parameterName);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   * @see java.sql.CallableStatement#getBlob(String)
   */
  public Blob getBlob(String parameterName) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getBlob(" + Util.toString(parameterName) + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      Blob result = callableStatement.getBlob(parameterName);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   * @see java.sql.CallableStatement#getBoolean(String)
   */
  public boolean getBoolean(String parameterName) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getBoolean(" + Util.toString(parameterName) + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      boolean result = callableStatement.getBoolean(parameterName);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   * @see java.sql.CallableStatement#getByte(String)
   */
  public byte getByte(String parameterName) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getByte(" + Util.toString(parameterName) + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      byte result = callableStatement.getByte(parameterName);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, String.valueOf(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   * @see java.sql.CallableStatement#getBytes(String)
   */
  public byte[] getBytes(String parameterName) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getBytes(" + Util.toString(parameterName) + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      byte[] result = callableStatement.getBytes(parameterName);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   * @see java.sql.CallableStatement#getClob(String)
   */
  public Clob getClob(String parameterName) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getClob(" + Util.toString(parameterName) + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      Clob result = callableStatement.getClob(parameterName);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   * @see java.sql.CallableStatement#getDate(String, Calendar)
   */
  public Date getDate(String parameterName, Calendar cal) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getDate(" + Util.toString(parameterName) + ", " + Util.toString(cal) + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      Date result = callableStatement.getDate(parameterName, cal);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, String.valueOf(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   * @see java.sql.CallableStatement#getDate(String)
   */
  public Date getDate(String parameterName) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getDate(" + Util.toString(parameterName) + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      Date result = callableStatement.getDate(parameterName);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, String.valueOf(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   * @see java.sql.CallableStatement#getDouble(String)
   */
  public double getDouble(String parameterName) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getDouble(" + Util.toString(parameterName) + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      double result = callableStatement.getDouble(parameterName);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, String.valueOf(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   * @see java.sql.CallableStatement#getFloat(String)
   */
  public float getFloat(String parameterName) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getFloat(" + Util.toString(parameterName) + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      float result = callableStatement.getFloat(parameterName);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, String.valueOf(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   * @see java.sql.CallableStatement#getInt(String)
   */
  public int getInt(String parameterName) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getInt(" + Util.toString(parameterName) + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      int result = callableStatement.getInt(parameterName);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, String.valueOf(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   * @see java.sql.CallableStatement#getLong(String)
   */
  public long getLong(String parameterName) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getLong(" + Util.toString(parameterName) + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      long result = callableStatement.getLong(parameterName);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, String.valueOf(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   * @see java.sql.CallableStatement#getObject(String, Map)
   */
  public Object getObject(String parameterName, Map map) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getObject(" + Util.toString(parameterName) + ", " + Util.toString(map) + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      Object result = callableStatement.getObject(parameterName, map);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   * @see java.sql.CallableStatement#getObject(String)
   */
  public Object getObject(String parameterName) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getObject(" + Util.toString(parameterName) + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      Object result = callableStatement.getObject(parameterName);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   * @see java.sql.CallableStatement#getRef(String)
   */
  public Ref getRef(String parameterName) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getRef(" + Util.toString(parameterName) + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      Ref result = callableStatement.getRef(parameterName);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   * @see java.sql.CallableStatement#getShort(String)
   */
  public short getShort(String parameterName) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getShort(" + Util.toString(parameterName) + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      short result = callableStatement.getShort(parameterName);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, String.valueOf(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   * @see java.sql.CallableStatement#getString(String)
   */
  public String getString(String parameterName) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getString(" + Util.toString(parameterName) + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      String result = callableStatement.getString(parameterName);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, String.valueOf(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   * @see java.sql.CallableStatement#getTime(String, Calendar)
   */
  public Time getTime(String parameterName, Calendar cal) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getTime(" + Util.toString(parameterName) + ", " + Util.toString(cal) + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      Time result = callableStatement.getTime(parameterName, cal);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   * @see java.sql.CallableStatement#getTime(String)
   */
  public Time getTime(String parameterName) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getTime(" + Util.toString(parameterName) + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      Time result = callableStatement.getTime(parameterName);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   * @see java.sql.CallableStatement#getTimestamp(String, Calendar)
   */
  public Timestamp getTimestamp(String parameterName, Calendar cal)
    throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getTimestamp(" + Util.toString(parameterName) + ", " + Util.toString(cal) + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      Timestamp result = callableStatement.getTimestamp(parameterName, cal);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, String.valueOf(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   * @see java.sql.CallableStatement#getTimestamp(String)
   */
  public Timestamp getTimestamp(String parameterName) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getTimestamp(" + Util.toString(parameterName) + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      Timestamp result = callableStatement.getTimestamp(parameterName);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, String.valueOf(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   * @see java.sql.CallableStatement#getURL(int)
   */
  public URL getURL(int parameterIndex) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getURL(" + parameterIndex + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      URL result = callableStatement.getURL(parameterIndex);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   * @see java.sql.CallableStatement#getURL(String)
   */
  public URL getURL(String parameterName) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 6)
      key = Util.traceBegin(prefix + " getURL(" + Util.toString(parameterName) + ")");

    long duration = Long.MIN_VALUE;
    long start = 0L;
    SQLException excp;

    try
    {
      start = System.currentTimeMillis();
      URL result = callableStatement.getURL(parameterName);
      duration = System.currentTimeMillis() - start;

      if (data.trace >= 6)
        Util.traceEnd(key, Util.toString(result));
      return result;
    }
    catch (SQLException e)
    {
      if (data.trace >= 6)
        Util.traceEnd(key, e);
      excp = e;
    }
    finally
    {
      if (duration == Long.MIN_VALUE)
        duration = System.currentTimeMillis() - start;
      statistic.column(duration);
      checkWarnings();
    }
    throw excp;
  }

  /**
   * @see java.sql.CallableStatement#registerOutParameter(String, int, int)
   */
  public void registerOutParameter(
    String parameterName,
    int sqlType,
    int scale)
    throws SQLException
  {
    long key = 0L;

    if (data.trace >= 5)
      key = Util.traceBegin(prefix + " registerOutParameter(" + parameterName + ", " + sqlType + ", " + scale + ")");

    try
    {
      callableStatement.registerOutParameter(parameterName, sqlType, scale);

      if (data.trace >= 5)
        Util.traceEnd(key, (String)null);
    }
    catch (SQLException e)
    {
      if (data.trace >= 5)
        Util.traceEnd(key, e);
      throw e;
    }
    finally
    {
      checkWarnings();
    }
  }

  /**
   * @see java.sql.CallableStatement#registerOutParameter(String, int, String)
   */
  public void registerOutParameter(
    String parameterName,
    int sqlType,
    String typeName)
    throws SQLException
  {
    long key = 0L;

    if (data.trace >= 5)
      key = Util.traceBegin(prefix + " registerOutParameter(" + parameterName + ", " + sqlType + ", " + typeName + ")");

    try
    {
      callableStatement.registerOutParameter(parameterName, sqlType, typeName);

      if (data.trace >= 5)
        Util.traceEnd(key, (String)null);
    }
    catch (SQLException e)
    {
      if (data.trace >= 5)
        Util.traceEnd(key, e);
      throw e;
    }
    finally
    {
      checkWarnings();
    }
  }

  /**
   * @see java.sql.CallableStatement#registerOutParameter(String, int)
   */
  public void registerOutParameter(String parameterName, int sqlType)
    throws SQLException
  {
    long key = 0L;

    if (data.trace >= 5)
      key = Util.traceBegin(prefix + " registerOutParameter(" + Util.toString(parameterName) + ", " + sqlType + ")");

    try
    {
      callableStatement.registerOutParameter(parameterName, sqlType);

      if (data.trace >= 5)
        Util.traceEnd(key, (String)null);
    }
    catch (SQLException e)
    {
      if (data.trace >= 5)
        Util.traceEnd(key, e);
      throw e;
    }
    finally
    {
      checkWarnings();
    }
  }

  /**
   * @see java.sql.CallableStatement#setAsciiStream(String, InputStream, int)
   */
  public void setAsciiStream(String parameterName, InputStream x, int length)
    throws SQLException
  {
    long key = 0L;

    if (data.trace >= 5)
      key = Util.traceBegin(prefix + " setAsciiStream(" + Util.toString(parameterName) + ", " + Util.toString(x) + ", " + length + ")");

    try
    {
      callableStatement.setAsciiStream(parameterName, x, length);

      if (data.trace >= 5)
        Util.traceEnd(key, (String)null);
    }
    catch (SQLException e)
    {
      if (data.trace >= 5)
        Util.traceEnd(key, e);
      throw e;
    }
    finally
    {
      checkWarnings();
    }
  }

  /**
   * @see java.sql.CallableStatement#setBigDecimal(String, BigDecimal)
   */
  public void setBigDecimal(String parameterName, BigDecimal x)
    throws SQLException
  {
    long key = 0L;

    if (data.trace >= 5)
      key = Util.traceBegin(prefix + " setBigDecimal(" + Util.toString(parameterName) + ", BigDecimal)");

    try
    {
      callableStatement.setBigDecimal(parameterName, x);

      if (data.trace >= 5)
        Util.traceEnd(key, (String)null);
    }
    catch (SQLException e)
    {
      if (data.trace >= 5)
        Util.traceEnd(key, e);
      throw e;
    }
    finally
    {
      checkWarnings();
    }
  }

  /**
   * @see java.sql.CallableStatement#setBinaryStream(String, InputStream, int)
   */
  public void setBinaryStream(String parameterName, InputStream x, int length)
    throws SQLException
  {
    long key = 0L;

    if (data.trace >= 5)
      key = Util.traceBegin(prefix + " setBinaryStream(" + Util.toString(parameterName) + ", " + Util.toString(x) + ", " + length + ")");

    try
    {
      callableStatement.setBinaryStream(parameterName, x, length);

      if (data.trace >= 5)
        Util.traceEnd(key, (String)null);
    }
    catch (SQLException e)
    {
      if (data.trace >= 5)
        Util.traceEnd(key, e);
      throw e;
    }
    finally
    {
      checkWarnings();
    }
  }

  /**
   * @see java.sql.CallableStatement#setBoolean(String, boolean)
   */
  public void setBoolean(String parameterName, boolean x) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 5)
      key = Util.traceBegin(prefix + " setBoolean(" + Util.toString(parameterName) + ", boolean)");

    try
    {
      callableStatement.setBoolean(parameterName, x);

      if (data.trace >= 5)
        Util.traceEnd(key, (String)null);
    }
    catch (SQLException e)
    {
      if (data.trace >= 5)
        Util.traceEnd(key, e);
      throw e;
    }
    finally
    {
      checkWarnings();
    }
  }

  /**
   * @see java.sql.CallableStatement#setByte(String, byte)
   */
  public void setByte(String parameterName, byte x) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 5)
      key = Util.traceBegin(prefix + " setByte(" + Util.toString(parameterName) + ", " + x + ")");

    try
    {
      callableStatement.setByte(parameterName, x);

      if (data.trace >= 5)
        Util.traceEnd(key, (String)null);
    }
    catch (SQLException e)
    {
      if (data.trace >= 5)
        Util.traceEnd(key, e);
      throw e;
    }
    finally
    {
      checkWarnings();
    }
  }

  /**
   * @see java.sql.CallableStatement#setBytes(String, byte[])
   */
  public void setBytes(String parameterName, byte[] x) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 5)
      key = Util.traceBegin(prefix + " setBytes(" + Util.toString(parameterName) + ", " + Util.toString(x) + ")");

    try
    {
      callableStatement.setBytes(parameterName, x);

      if (data.trace >= 5)
        Util.traceEnd(key, (String)null);
    }
    catch (SQLException e)
    {
      if (data.trace >= 5)
        Util.traceEnd(key, e);
      throw e;
    }
    finally
    {
      checkWarnings();
    }
  }

  /**
   * @see java.sql.CallableStatement#setCharacterStream(String, Reader, int)
   */
  public void setCharacterStream(
    String parameterName,
    Reader reader,
    int length)
    throws SQLException
  {
    long key = 0L;

    if (data.trace >= 5)
      key = Util.traceBegin(prefix + " setCharacterStream(" + parameterName + ", " + Util.toString(reader) + ", " + length + ")");

    try
    {
      callableStatement.setCharacterStream(parameterName, reader, length);

      if (data.trace >= 5)
        Util.traceEnd(key, (String)null);
    }
    catch (SQLException e)
    {
      if (data.trace >= 5)
        Util.traceEnd(key, e);
      throw e;
    }
    finally
    {
      checkWarnings();
    }
  }

  /**
   * @see java.sql.CallableStatement#setDate(String, Date, Calendar)
   */
  public void setDate(String parameterName, Date x, Calendar cal)
    throws SQLException
  {
    long key = 0L;

    if (data.trace >= 5)
      key = Util.traceBegin(prefix + " setDate(" + Util.toString(parameterName) + ", " + x + ", " + Util.toString(cal) + ")");

    try
    {
      callableStatement.setDate(parameterName, x, cal);

      if (data.trace >= 5)
        Util.traceEnd(key, (String)null);
    }
    catch (SQLException e)
    {
      if (data.trace >= 5)
        Util.traceEnd(key, e);
      throw e;
    }
    finally
    {
      checkWarnings();
    }
  }

  /**
   * @see java.sql.CallableStatement#setDate(String, Date)
   */
  public void setDate(String parameterName, Date x) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 5)
      key = Util.traceBegin(prefix + " setDate(" + Util.toString(parameterName) + ", " + x + ")");

    try
    {
      callableStatement.setDate(parameterName, x);

      if (data.trace >= 5)
        Util.traceEnd(key, (String)null);
    }
    catch (SQLException e)
    {
      if (data.trace >= 5)
        Util.traceEnd(key, e);
      throw e;
    }
    finally
    {
      checkWarnings();
    }
  }

  /**
   * @see java.sql.CallableStatement#setDouble(String, double)
   */
  public void setDouble(String parameterName, double x) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 5)
      key = Util.traceBegin(prefix + " setDouble(" + Util.toString(parameterName) + ", " + x + ")");

    try
    {
      callableStatement.setDouble(parameterName, x);

      if (data.trace >= 5)
        Util.traceEnd(key, (String)null);
    }
    catch (SQLException e)
    {
      if (data.trace >= 5)
        Util.traceEnd(key, e);
      throw e;
    }
    finally
    {
      checkWarnings();
    }
  }

  /**
   * @see java.sql.CallableStatement#setFloat(String, float)
   */
  public void setFloat(String parameterName, float x) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 5)
      key = Util.traceBegin(prefix + " setFloat(" + Util.toString(parameterName) + ", " + x + ")");

    try
    {
      callableStatement.setFloat(parameterName, x);

      if (data.trace >= 5)
        Util.traceEnd(key, (String)null);
    }
    catch (SQLException e)
    {
      if (data.trace >= 5)
        Util.traceEnd(key, e);
      throw e;
    }
    finally
    {
      checkWarnings();
    }
  }

  /**
   * @see java.sql.CallableStatement#setInt(String, int)
   */
  public void setInt(String parameterName, int x) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 5)
      key = Util.traceBegin(prefix + " setInt(" + Util.toString(parameterName) + ", " + x + ")");

    try
    {
      callableStatement.setInt(parameterName, x);

      if (data.trace >= 5)
        Util.traceEnd(key, (String)null);
    }
    catch (SQLException e)
    {
      if (data.trace >= 5)
        Util.traceEnd(key, e);
      throw e;
    }
    finally
    {
      checkWarnings();
    }
  }

  /**
   * @see java.sql.CallableStatement#setLong(String, long)
   */
  public void setLong(String parameterName, long x) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 5)
      key = Util.traceBegin(prefix + " setLong(" + Util.toString(parameterName) + ", " + x + ")");

    try
    {
      callableStatement.setLong(parameterName, x);

      if (data.trace >= 5)
        Util.traceEnd(key, (String)null);
    }
    catch (SQLException e)
    {
      if (data.trace >= 5)
        Util.traceEnd(key, e);
      throw e;
    }
    finally
    {
      checkWarnings();
    }
  }

  /**
   * @see java.sql.CallableStatement#setNull(String, int)
   */
  public void setNull(String parameterName, int sqlType) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 5)
      key = Util.traceBegin(prefix + " setNull(" + Util.toString(parameterName) + ", " + sqlType + ")");

    try
    {
      callableStatement.setNull(parameterName, sqlType);

      if (data.trace >= 5)
        Util.traceEnd(key, (String)null);
    }
    catch (SQLException e)
    {
      if (data.trace >= 5)
        Util.traceEnd(key, e);
      throw e;
    }
    finally
    {
      checkWarnings();
    }
  }

  /**
   * @see java.sql.CallableStatement#setObject(String, Object, int, int)
   */
  public void setObject(
    String parameterName,
    Object x,
    int targetSqlType,
    int scale)
    throws SQLException
  {
    long key = 0L;

    if (data.trace >= 5)
      key = Util.traceBegin(prefix + " setObject(" + parameterName + ", " + Util.toString(x) + ", " + targetSqlType + ", " + scale + ")");

    try
    {
      callableStatement.setObject(parameterName, x, targetSqlType, scale);

      if (data.trace >= 5)
        Util.traceEnd(key, (String)null);
    }
    catch (SQLException e)
    {
      if (data.trace >= 5)
        Util.traceEnd(key, e);
      throw e;
    }
    finally
    {
      checkWarnings();
    }
  }

  /**
   * @see java.sql.CallableStatement#setObject(String, Object, int)
   */
  public void setObject(String parameterName, Object x, int targetSqlType)
    throws SQLException
  {
    long key = 0L;

    if (data.trace >= 5)
      key = Util.traceBegin(prefix + " setObject(" + Util.toString(parameterName) + ", " + Util.toString(x) + ", " + targetSqlType + ")");

    try
    {
      callableStatement.setObject(parameterName, x, targetSqlType);

      if (data.trace >= 5)
        Util.traceEnd(key, (String)null);
    }
    catch (SQLException e)
    {
      if (data.trace >= 5)
        Util.traceEnd(key, e);
      throw e;
    }
    finally
    {
      checkWarnings();
    }
  }

  /**
   * @see java.sql.CallableStatement#setObject(String, Object)
   */
  public void setObject(String parameterName, Object x) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 5)
      key = Util.traceBegin(prefix + " setObject(" + Util.toString(parameterName) + ", " + Util.toString(x) + ")");

    try
    {
      callableStatement.setObject(parameterName, x);

      if (data.trace >= 5)
        Util.traceEnd(key, (String)null);
    }
    catch (SQLException e)
    {
      if (data.trace >= 5)
        Util.traceEnd(key, e);
      throw e;
    }
    finally
    {
      checkWarnings();
    }
  }

  /**
   * @see java.sql.CallableStatement#setShort(String, short)
   */
  public void setShort(String parameterName, short x) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 5)
      key = Util.traceBegin(prefix + " setShort(" + Util.toString(parameterName) + ", " + x + ")");

    try
    {
      callableStatement.setShort(parameterName, x);

      if (data.trace >= 5)
        Util.traceEnd(key, (String)null);
    }
    catch (SQLException e)
    {
      if (data.trace >= 5)
        Util.traceEnd(key, e);
      throw e;
    }
    finally
    {
      checkWarnings();
    }
  }

  /**
   * @see java.sql.CallableStatement#setString(String, String)
   */
  public void setString(String parameterName, String x) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 5)
      key = Util.traceBegin(prefix + " setString(" + Util.toString(parameterName) + ", " + x + ")");

    try
    {
      callableStatement.setString(parameterName, x);

      if (data.trace >= 5)
        Util.traceEnd(key, (String)null);
    }
    catch (SQLException e)
    {
      if (data.trace >= 5)
        Util.traceEnd(key, e);
      throw e;
    }
    finally
    {
      checkWarnings();
    }
  }

  /**
   * @see java.sql.CallableStatement#setTime(String, Time, Calendar)
   */
  public void setTime(String parameterName, Time x, Calendar cal)
    throws SQLException
  {
    long key = 0L;

    if (data.trace >= 5)
      key = Util.traceBegin(prefix + " setTime(" + Util.toString(parameterName) + ", " + Util.toString(x) + ", " + Util.toString(cal) + ")");

    try
    {
      callableStatement.setTime(parameterName, x, cal);

      if (data.trace >= 5)
        Util.traceEnd(key, (String)null);
    }
    catch (SQLException e)
    {
      if (data.trace >= 5)
        Util.traceEnd(key, e);
      throw e;
    }
    finally
    {
      checkWarnings();
    }
  }

  /**
   * @see java.sql.CallableStatement#setTime(String, Time)
   */
  public void setTime(String parameterName, Time x) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 5)
      key = Util.traceBegin(prefix + " setTime(" + Util.toString(parameterName) + ", " + Util.toString(x) + ")");

    try
    {
      callableStatement.setTime(parameterName, x);

      if (data.trace >= 5)
        Util.traceEnd(key, (String)null);
    }
    catch (SQLException e)
    {
      if (data.trace >= 5)
        Util.traceEnd(key, e);
      throw e;
    }
    finally
    {
      checkWarnings();
    }
  }

  /**
   * @see java.sql.CallableStatement#setTimestamp(String, Timestamp, Calendar)
   */
  public void setTimestamp(String parameterName, Timestamp x, Calendar cal)
    throws SQLException
  {
    long key = 0L;

    if (data.trace >= 5)
      key = Util.traceBegin(prefix + " setTimestamp(" + Util.toString(parameterName) + ", " + x + ", " + Util.toString(cal) + ")");

    try
    {
      callableStatement.setTimestamp(parameterName, x, cal);

      if (data.trace >= 5)
        Util.traceEnd(key, (String)null);
    }
    catch (SQLException e)
    {
      if (data.trace >= 5)
        Util.traceEnd(key, e);
      throw e;
    }
    finally
    {
      checkWarnings();
    }
  }

  /**
   * @see java.sql.CallableStatement#setTimestamp(String, Timestamp)
   */
  public void setTimestamp(String parameterName, Timestamp x)
    throws SQLException
  {
    long key = 0L;

    if (data.trace >= 5)
      key = Util.traceBegin(prefix + " setTimestamp(" + Util.toString(parameterName) + ", " + x + ")");

    try
    {
      callableStatement.setTimestamp(parameterName, x);

      if (data.trace >= 5)
        Util.traceEnd(key, (String)null);
    }
    catch (SQLException e)
    {
      if (data.trace >= 5)
        Util.traceEnd(key, e);
      throw e;
    }
    finally
    {
      checkWarnings();
    }
  }

  /**
   * @see java.sql.CallableStatement#setURL(String, URL)
   */
  public void setURL(String parameterName, URL val) throws SQLException
  {
    long key = 0L;

    if (data.trace >= 5)
      key = Util.traceBegin(prefix + " setURL(" + Util.toString(parameterName) + ", URL)");

    try
    {
      callableStatement.setURL(parameterName, val);

      if (data.trace >= 5)
        Util.traceEnd(key, (String)null);
    }
    catch (SQLException e)
    {
      if (data.trace >= 5)
        Util.traceEnd(key, e);
      throw e;
    }
    finally
    {
      checkWarnings();
    }
  }
    /* (non-Javadoc)
     * @see java.sql.CallableStatement#setNull(String, int, String)
     */
  public void setNull(String parameterName, int sqlType, String typeName)
    throws SQLException
  {
    long key = 0L;

    if (data.trace >= 5)
      key = Util.traceBegin(prefix + " setNull(" + Util.toString(parameterName) + ", " + sqlType + ", " + typeName + ")");

    try
    {
      callableStatement.setNull(parameterName, sqlType, typeName);

      if (data.trace >= 5)
        Util.traceEnd(key, (String)null);
    }
    catch (SQLException e)
    {
      if (data.trace >= 5)
        Util.traceEnd(key, e);
      throw e;
    }
    finally
    {
      checkWarnings();
    }
  }

//    public NClob getNClob(String parameterName) throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 6)
//            key = Util.traceBegin(prefix + " getNClob(parameterName)");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            NClob result = callableStatement.getNClob(parameterName);
//            duration = System.currentTimeMillis() - start;
//
//            if (data.trace >= 6)
//                Util.traceEnd(key, Util.toString(result));
//            return result;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 6)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//        finally
//        {
//            if (duration == Long.MIN_VALUE)
//                duration = System.currentTimeMillis() - start;
//            statistic.column(duration);
//            checkWarnings();
//        }
//    }
//
//    public NClob getNClob(int parameterIndex) throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 6)
//            key = Util.traceBegin(prefix + " getNClob(parameterIndex)");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            NClob result = callableStatement.getNClob(parameterIndex);
//            duration = System.currentTimeMillis() - start;
//
//            if (data.trace >= 6)
//                Util.traceEnd(key, Util.toString(result));
//            return result;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 6)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//        finally
//        {
//            if (duration == Long.MIN_VALUE)
//                duration = System.currentTimeMillis() - start;
//            statistic.column(duration);
//            checkWarnings();
//        }
//    }
//
//    public Reader getCharacterStream(String parameterName) throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 6)
//            key = Util.traceBegin(prefix + " getCharacterStream(parameterName)");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            Reader result = callableStatement.getCharacterStream(parameterName);
//            duration = System.currentTimeMillis() - start;
//
//            if (data.trace >= 6)
//                Util.traceEnd(key, Util.toString(result));
//            return result;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 6)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//        finally
//        {
//            if (duration == Long.MIN_VALUE)
//                duration = System.currentTimeMillis() - start;
//            statistic.column(duration);
//            checkWarnings();
//        }
//    }
//
//    public Reader getCharacterStream(int parameterIndex) throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 6)
//            key = Util.traceBegin(prefix + " getCharacterStream(parameterIndex)");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            Reader result = callableStatement.getCharacterStream(parameterIndex);
//            duration = System.currentTimeMillis() - start;
//
//            if (data.trace >= 6)
//                Util.traceEnd(key, Util.toString(result));
//            return result;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 6)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//        finally
//        {
//            if (duration == Long.MIN_VALUE)
//                duration = System.currentTimeMillis() - start;
//            statistic.column(duration);
//            checkWarnings();
//        }
//    }
//
//    public Reader getNCharacterStream(String parameterName) throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 6)
//            key = Util.traceBegin(prefix + " getNCharacterStream(parameterName)");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            Reader result = callableStatement.getNCharacterStream(parameterName);
//            duration = System.currentTimeMillis() - start;
//
//            if (data.trace >= 6)
//                Util.traceEnd(key, Util.toString(result));
//            return result;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 6)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//        finally
//        {
//            if (duration == Long.MIN_VALUE)
//                duration = System.currentTimeMillis() - start;
//            statistic.column(duration);
//            checkWarnings();
//        }
//    }
//
//    public Reader getNCharacterStream(int parameterIndex) throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 6)
//            key = Util.traceBegin(prefix + " getNCharacterStream(parameterIndex)");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            Reader result = callableStatement.getNCharacterStream(parameterIndex);
//            duration = System.currentTimeMillis() - start;
//
//            if (data.trace >= 6)
//                Util.traceEnd(key, Util.toString(result));
//            return result;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 6)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//        finally
//        {
//            if (duration == Long.MIN_VALUE)
//                duration = System.currentTimeMillis() - start;
//            statistic.column(duration);
//            checkWarnings();
//        }
//    }
//
//    public RowId getRowId(String parameterName) throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 6)
//            key = Util.traceBegin(prefix + " getRowId(parameterName)");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            RowId result = callableStatement.getRowId(parameterName);
//            duration = System.currentTimeMillis() - start;
//
//            if (data.trace >= 6)
//                Util.traceEnd(key, Util.toString(result));
//            return result;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 6)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//        finally
//        {
//            if (duration == Long.MIN_VALUE)
//                duration = System.currentTimeMillis() - start;
//            statistic.column(duration);
//            checkWarnings();
//        }
//    }
//
//    public RowId getRowId(int parameterIndex) throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 6)
//            key = Util.traceBegin(prefix + " getRowId(parameterIndex)");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            RowId result = callableStatement.getRowId(parameterIndex);
//            duration = System.currentTimeMillis() - start;
//
//            if (data.trace >= 6)
//                Util.traceEnd(key, Util.toString(result));
//            return result;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 6)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//        finally
//        {
//            if (duration == Long.MIN_VALUE)
//                duration = System.currentTimeMillis() - start;
//            statistic.column(duration);
//            checkWarnings();
//        }
//    }
//
//    public SQLXML getSQLXML(String parameterName) throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 6)
//            key = Util.traceBegin(prefix + " getSQLXML(parameterName)");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            SQLXML result = callableStatement.getSQLXML(parameterName);
//            duration = System.currentTimeMillis() - start;
//
//            if (data.trace >= 6)
//                Util.traceEnd(key, Util.toString(result));
//            return result;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 6)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//        finally
//        {
//            if (duration == Long.MIN_VALUE)
//                duration = System.currentTimeMillis() - start;
//            statistic.column(duration);
//            checkWarnings();
//        }
//    }
//
//    public SQLXML getSQLXML(int parameterIndex) throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 6)
//            key = Util.traceBegin(prefix + " getSQLXML(parameterIndex)");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            SQLXML result = callableStatement.getSQLXML(parameterIndex);
//            duration = System.currentTimeMillis() - start;
//
//            if (data.trace >= 6)
//                Util.traceEnd(key, Util.toString(result));
//            return result;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 6)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//        finally
//        {
//            if (duration == Long.MIN_VALUE)
//                duration = System.currentTimeMillis() - start;
//            statistic.column(duration);
//            checkWarnings();
//        }
//    }
//
//    public String getNString(String parameterName) throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 6)
//            key = Util.traceBegin(prefix + " getNString(parameterName)");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            String result = callableStatement.getNString(parameterName);
//            duration = System.currentTimeMillis() - start;
//
//            if (data.trace >= 6)
//                Util.traceEnd(key, Util.toString(result));
//            return result;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 6)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//        finally
//        {
//            if (duration == Long.MIN_VALUE)
//                duration = System.currentTimeMillis() - start;
//            statistic.column(duration);
//            checkWarnings();
//        }
//    }
//
//    public String getNString(int parameterIndex) throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 6)
//            key = Util.traceBegin(prefix + " getNString(parameterIndex)");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            String result = callableStatement.getNString(parameterIndex);
//            duration = System.currentTimeMillis() - start;
//
//            if (data.trace >= 6)
//                Util.traceEnd(key, Util.toString(result));
//            return result;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 6)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//        finally
//        {
//            if (duration == Long.MIN_VALUE)
//                duration = System.currentTimeMillis() - start;
//            statistic.column(duration);
//            checkWarnings();
//        }
//    }
//
//    public void setAsciiStream(String parameterName, InputStream x) throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 6)
//            key = Util.traceBegin(prefix + " setAsciiStream(parameterName, x)");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            callableStatement.setAsciiStream(parameterName, x);
//            duration = System.currentTimeMillis() - start;
//
//            if (data.trace >= 6)
//                Util.traceEnd(key, (String)null);
//            return;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 6)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//        finally
//        {
//            if (duration == Long.MIN_VALUE)
//                duration = System.currentTimeMillis() - start;
//            statistic.column(duration);
//            checkWarnings();
//        }
//    }
//
//    public void setAsciiStream(String parameterName, InputStream x, long length) throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 6)
//            key = Util.traceBegin(prefix + " setAsciiStream(parameterName, x, length)");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            callableStatement.setAsciiStream(parameterName, x, length);
//            duration = System.currentTimeMillis() - start;
//
//            if (data.trace >= 6)
//                Util.traceEnd(key, (String)null);
//            return;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 6)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//        finally
//        {
//            if (duration == Long.MIN_VALUE)
//                duration = System.currentTimeMillis() - start;
//            statistic.column(duration);
//            checkWarnings();
//        }
//    }
//
//    public void setBinaryStream(String parameterName, InputStream x) throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 6)
//            key = Util.traceBegin(prefix + " setBinaryStream(parameterName, x)");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            callableStatement.setBinaryStream(parameterName, x);
//            duration = System.currentTimeMillis() - start;
//
//            if (data.trace >= 6)
//                Util.traceEnd(key, (String)null);
//            return;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 6)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//        finally
//        {
//            if (duration == Long.MIN_VALUE)
//                duration = System.currentTimeMillis() - start;
//            statistic.column(duration);
//            checkWarnings();
//        }
//    }
//
//    public void setBinaryStream(String parameterName, InputStream x, long length) throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 6)
//            key = Util.traceBegin(prefix + " setBinaryStream(parameterName, x, length)");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            callableStatement.setBinaryStream(parameterName, x, length);
//            duration = System.currentTimeMillis() - start;
//
//            if (data.trace >= 6)
//                Util.traceEnd(key, (String)null);
//            return;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 6)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//        finally
//        {
//            if (duration == Long.MIN_VALUE)
//                duration = System.currentTimeMillis() - start;
//            statistic.column(duration);
//            checkWarnings();
//        }
//    }
//
//    public void setBlob(String parameterName, Blob x) throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 6)
//            key = Util.traceBegin(prefix + " setBlob(parameterName, x)");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            callableStatement.setBlob(parameterName, x);
//            duration = System.currentTimeMillis() - start;
//
//            if (data.trace >= 6)
//                Util.traceEnd(key, (String)null);
//            return;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 6)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//        finally
//        {
//            if (duration == Long.MIN_VALUE)
//                duration = System.currentTimeMillis() - start;
//            statistic.column(duration);
//            checkWarnings();
//        }
//    }
//
//    public void setBlob(String parameterName, InputStream inputStream) throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 6)
//            key = Util.traceBegin(prefix + " setBlob(parameterName, inputStream)");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            callableStatement.setBlob(parameterName, inputStream);
//            duration = System.currentTimeMillis() - start;
//
//            if (data.trace >= 6)
//                Util.traceEnd(key, (String)null);
//            return;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 6)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//        finally
//        {
//            if (duration == Long.MIN_VALUE)
//                duration = System.currentTimeMillis() - start;
//            statistic.column(duration);
//            checkWarnings();
//        }
//    }
//
//    public void setBlob(String parameterName, InputStream inputStream, long length) throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 6)
//            key = Util.traceBegin(prefix + " setBlob(parameterName, inputStream, length)");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            callableStatement.setBlob(parameterName, inputStream, length);
//            duration = System.currentTimeMillis() - start;
//
//            if (data.trace >= 6)
//                Util.traceEnd(key, (String)null);
//            return;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 6)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//        finally
//        {
//            if (duration == Long.MIN_VALUE)
//                duration = System.currentTimeMillis() - start;
//            statistic.column(duration);
//            checkWarnings();
//        }
//    }
//
//    public void setCharacterStream(String parameterName, Reader reader) throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 6)
//            key = Util.traceBegin(prefix + " setCharacterStream(parameterName, reader)");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            callableStatement.setCharacterStream(parameterName, reader);
//            duration = System.currentTimeMillis() - start;
//
//            if (data.trace >= 6)
//                Util.traceEnd(key, (String)null);
//            return;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 6)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//        finally
//        {
//            if (duration == Long.MIN_VALUE)
//                duration = System.currentTimeMillis() - start;
//            statistic.column(duration);
//            checkWarnings();
//        }
//    }
//
//    public void setCharacterStream(String parameterName, Reader reader, long length) throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 6)
//            key = Util.traceBegin(prefix + " setCharacterStream(parameterName, reader, length)");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            callableStatement.setCharacterStream(parameterName, reader, length);
//            duration = System.currentTimeMillis() - start;
//
//            if (data.trace >= 6)
//                Util.traceEnd(key, (String)null);
//            return;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 6)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//        finally
//        {
//            if (duration == Long.MIN_VALUE)
//                duration = System.currentTimeMillis() - start;
//            statistic.column(duration);
//            checkWarnings();
//        }
//    }
//
//    public void setClob(String parameterName, Clob x) throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 6)
//            key = Util.traceBegin(prefix + " setClob(parameterName, x)");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            callableStatement.setClob(parameterName, x);
//            duration = System.currentTimeMillis() - start;
//
//            if (data.trace >= 6)
//                Util.traceEnd(key, (String)null);
//            return;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 6)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//        finally
//        {
//            if (duration == Long.MIN_VALUE)
//                duration = System.currentTimeMillis() - start;
//            statistic.column(duration);
//            checkWarnings();
//        }
//    }
//
//    public void setClob(String parameterName, Reader reader) throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 6)
//            key = Util.traceBegin(prefix + " setClob(parameterName, reader)");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            callableStatement.setClob(parameterName, reader);
//            duration = System.currentTimeMillis() - start;
//
//            if (data.trace >= 6)
//                Util.traceEnd(key, (String)null);
//            return;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 6)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//        finally
//        {
//            if (duration == Long.MIN_VALUE)
//                duration = System.currentTimeMillis() - start;
//            statistic.column(duration);
//            checkWarnings();
//        }
//    }
//
//    public void setClob(String parameterName, Reader reader, long length) throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 6)
//            key = Util.traceBegin(prefix + " setClob(parameterName, reader, length)");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            callableStatement.setClob(parameterName, reader, length);
//            duration = System.currentTimeMillis() - start;
//
//            if (data.trace >= 6)
//                Util.traceEnd(key, (String)null);
//            return;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 6)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//        finally
//        {
//            if (duration == Long.MIN_VALUE)
//                duration = System.currentTimeMillis() - start;
//            statistic.column(duration);
//            checkWarnings();
//        }
//    }
//
//    public void setNCharacterStream(String parameterName, Reader value) throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 6)
//            key = Util.traceBegin(prefix + " setNCharacterStream(parameterName, value)");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            callableStatement.setNCharacterStream(parameterName, value);
//            duration = System.currentTimeMillis() - start;
//
//            if (data.trace >= 6)
//                Util.traceEnd(key, (String)null);
//            return;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 6)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//        finally
//        {
//            if (duration == Long.MIN_VALUE)
//                duration = System.currentTimeMillis() - start;
//            statistic.column(duration);
//            checkWarnings();
//        }
//    }
//
//    public void setNCharacterStream(String parameterName, Reader value, long length) throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 6)
//            key = Util.traceBegin(prefix + " setNCharacterStream(parameterName, value, length)");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            callableStatement.setNCharacterStream(parameterName, value, length);
//            duration = System.currentTimeMillis() - start;
//
//            if (data.trace >= 6)
//                Util.traceEnd(key, (String)null);
//            return;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 6)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//        finally
//        {
//            if (duration == Long.MIN_VALUE)
//                duration = System.currentTimeMillis() - start;
//            statistic.column(duration);
//            checkWarnings();
//        }
//    }
//
//    public void setNClob(String parameterName, NClob value) throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 6)
//            key = Util.traceBegin(prefix + " setNClob(parameterName, value)");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            callableStatement.setNClob(parameterName, value);
//            duration = System.currentTimeMillis() - start;
//
//            if (data.trace >= 6)
//                Util.traceEnd(key, (String)null);
//            return;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 6)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//        finally
//        {
//            if (duration == Long.MIN_VALUE)
//                duration = System.currentTimeMillis() - start;
//            statistic.column(duration);
//            checkWarnings();
//        }
//    }
//
//    public void setNClob(String parameterName, Reader reader) throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 6)
//            key = Util.traceBegin(prefix + " setNClob(parameterName, reader)");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            callableStatement.setNClob(parameterName, reader);
//            duration = System.currentTimeMillis() - start;
//
//            if (data.trace >= 6)
//                Util.traceEnd(key, (String)null);
//            return;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 6)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//        finally
//        {
//            if (duration == Long.MIN_VALUE)
//                duration = System.currentTimeMillis() - start;
//            statistic.column(duration);
//            checkWarnings();
//        }
//    }
//
//    public void setNClob(String parameterName, Reader reader, long length) throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 6)
//            key = Util.traceBegin(prefix + " setNClob(parameterName, reader, length)");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            callableStatement.setNClob(parameterName, reader, length);
//            duration = System.currentTimeMillis() - start;
//
//            if (data.trace >= 6)
//                Util.traceEnd(key, (String)null);
//            return;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 6)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//        finally
//        {
//            if (duration == Long.MIN_VALUE)
//                duration = System.currentTimeMillis() - start;
//            statistic.column(duration);
//            checkWarnings();
//        }
//    }
//
//    public void setNString(String parameterName, String value) throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 6)
//            key = Util.traceBegin(prefix + " setNString(parameterName, value)");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            callableStatement.setNString(parameterName, value);
//            duration = System.currentTimeMillis() - start;
//
//            if (data.trace >= 6)
//                Util.traceEnd(key, (String)null);
//            return;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 6)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//        finally
//        {
//            if (duration == Long.MIN_VALUE)
//                duration = System.currentTimeMillis() - start;
//            statistic.column(duration);
//            checkWarnings();
//        }
//    }
//
//    public void setRowId(String parameterName, RowId x) throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 6)
//            key = Util.traceBegin(prefix + " setRowId(parameterName, x)");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            callableStatement.setRowId(parameterName, x);
//            duration = System.currentTimeMillis() - start;
//
//            if (data.trace >= 6)
//                Util.traceEnd(key, (String)null);
//            return;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 6)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//        finally
//        {
//            if (duration == Long.MIN_VALUE)
//                duration = System.currentTimeMillis() - start;
//            statistic.column(duration);
//            checkWarnings();
//        }
//    }
//
//    public void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException
//    {
//        long key = 0L;
//        if (data.trace >= 6)
//            key = Util.traceBegin(prefix + " setSQLXML(parameterName, xmlObject)");
//
//        long duration = Long.MIN_VALUE;
//        long start = 0L;
//
//        try
//        {
//            start = System.currentTimeMillis();
//            callableStatement.setSQLXML(parameterName, xmlObject);
//            duration = System.currentTimeMillis() - start;
//
//            if (data.trace >= 6)
//                Util.traceEnd(key, (String)null);
//            return;
//        }
//        catch (SQLException e)
//        {
//            if (data.trace >= 6)
//                Util.traceEnd(key, e);
//            throw e;
//        }
//        finally
//        {
//            if (duration == Long.MIN_VALUE)
//                duration = System.currentTimeMillis() - start;
//            statistic.column(duration);
//            checkWarnings();
//        }
//    }
}
